import time

from po.Page.Page import Page
from po.Page.Page2 import Page2
from po.Page.Page3 import Page3
from selenium import webdriver
import pytest,json
@pytest.fixture()
def send_json(file):
    with open(file,'r',encoding='utf8') as f:
        data=json.load(f)
    return [(i['name'],i['password'])for i in data]
@pytest.mark.parametrize('name,password',send_json('hj.json'))
def driver():
    driver=webdriver.Edge()
    driver.maximize_window()
    yield driver
    driver.quit()

def test_a3mall(driver,name,password):
    po=Page(driver)
    po.a3mall_log(name,password)
    po2=Page2(driver)
    po2.a3mall_tuangou()
    po3=Page3(driver)
    po3.a3mall_jifen()
